Digital cameras are steadily increasing in popularity due to their declining costs, which make them well within the reach of the average consumer. In order to keep costs low, many color digital cameras are single-sensor digital cameras in which only a single image sensor is used to capture color information for each picture element (pixel) in a color image. Each image sensing element in a single-sensor digital camera, which is typically a charge-coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) chip, is part of a sensor array that represents the pixels of a color image. In view of the color filter array that is superimposed on the sensor, each image sensing element can only generate information about a single color at a given pixel. A color image, however, is represented by combining three separate monochromatic images. In order to display a color image, all of the red, blue and green (RGB) color values are needed at each pixel. In an ideal (and expensive) camera system, each pixel in the sensor array would be provided with three image sensors, each one measuring a red, green or blue pixel color. In a single-sensor digital camera, however, only a single red, blue or green color value can be determined at a given pixel. In order to obtain the other two missing colors, a technique must be used to estimate or interpolate the missing colors from surrounding pixels in the image. For each CCD or CMOS pixel, only one color is captured, either R, G, or B. Therefore, it is necessary to interpolate the data to generate the other two colors at every pixel. For example, the pixel marked with a ‘x’ in FIG. 1 is a “red pixel”, that is, at that location only the red color value is produced by the corresponding image sensing element. To obtain the green (G) and blue (B) values for that pixel, one needs to interpolate the green and blue data available from neighboring pixels. For example, to obtain the green value for the ‘x’ pixel 102 in FIG. 1, one could perform a bilinear interpolation based on the values of the green pixels marked ‘o’.
Estimating or interpolating missing colors as discussed above is called “demosaicing”. The “demosaicing” term is derived from the fact that a color filter array (CFA) is used in front of the image sensors, with the CFA being arranged in a mosaic pattern. This mosaic pattern has only one color value for each of the pixels in the image. In order to obtain the full-color image, the mosaic pattern must be “demosaiced”. Thus, demosaicing is the technique of interpolating back from the image captured with a mosaic-pattern CFA, so that a full RGB value can be associated with every pixel. More specifically, a single-sensor digital camera captures the image using an image sensor array that is preceded in the optical path by a CFA. A highly common mosaic CFA is called the Bayer mosaic pattern. The Bayer mosaic pattern (or Bayer filter 100) is shown in FIG. 1. (In this figure, the boxes with an “R” 104 represent red pixels, the boxes with a “G” 106 represent green pixels and the pixels with a “B” 108 represent blue pixels. The boxes with “0” 110 markings are also green pixels, while the box marked “X” 112 is also a red pixel.) For each 2×2 set of pixels, two diagonally opposed pixels have green filters, and the other two pixels have red and blue filters. Since the color green (G) carries most of the luminance information for humans, its sampling rate is twice that of the color red (R) and the color blue (B).